#pragma once
#include "mosquitto.h"

// 单实例对象
class MqttClient {
public:
    ~MqttClient(){};
    static MqttClient* GetIns() {
        static MqttClient instance;
        return &instance;
    }
    int ConnectMqttSrv(zmq::socket_t *pPubSock);
    int Publish(string point, const char* payload, uint len);
    int Publish(string point, string subName, const char* payload, uint len);
    int Publish(string point, string subName, const char* stringOut);

private:
    MqttClient(){};

private:
    struct mosquitto* _myClient = nullptr; // 连接句柄
};